#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
	int n = 0;
	int m = 0;
	scanf("%d%d", &n, &m);
	int i = 0;
	int j = 0;
	int num = 0;
	int max = 0;
	int x = 0;
	int y = 0;
	for (i = 1; i <= n; i++)
	{
		for (j = 1; j <= m; j++)
		{
			scanf("%d", &num);
			if (num > max)
			{
				max = num;
				x = i;
				y = j;
			}
		}
	}
	printf("%d %d\n", x, y);
	return 0;
}